#include <iostream>
#include <string>
using namespace std;
void myReverse(string &s,int left,int right){
    while(left<right){
        char tmp=s[left];
        s[left]=s[right];
        s[right]=tmp;
        left++;
        right--;
    }
    return ;
}
int main(){
    int k;
    cin>>k;
    string str;
    cin>>str;
    int n=str.length();
    myReverse(str,0,n-1);
    myReverse(str,0,k-1);
    myReverse(str,k,n-1);
    cout<<str<<endl;
    return 0;
}